<?php
class Application_Form_Usuario extends Zend_Form
{

    public function init()
    {
        $id_usuario = $this->createElement('hidden', 'id_usuario');

        $st_nome_usuario = $this->createElement('text', 'st_nome_usuario', array('label'=>'Nome: '))
                                ->addFilter('StringTrim')
                                ->addFilter('StringToLower')
                                ->addValidator('StringLength', false, array(3, 20))
                                ->setRequired(true);

        $st_email = $this->createElement('text', 'st_email', array('label'=>'Email: '))
                         ->addFilter('StringTrim')
                         ->addValidator('EmailAddress', false)
                                ->setRequired(true);

        $st_login = $this->createElement('text', 'st_login', array('label'=>'Login: '))
                         ->addFilter('StringTrim')
                         ->addFilter(new Websis_Filter_StringPad())
                         ->addValidator('Alnum')
                         ->addValidator('StringLength', false, array(3))
                         ->setRequired(true);

        $st_senha = $this->createElement('password', 'st_senha', array('label'=>'Senha: '));
        $st_senha->addValidator('StringLength', false, array(6));
        $st_senha->setRequired(true);

        $modelPerfil = new Application_Model_Perfil();

        $id_perfil = $this->createElement('select', 'id_perfil', array('label'=>'Perfil: '));
        $id_perfil->addMultiOptions($modelPerfil->getArraySelect());

        $this->addElements(array($id_usuario, $st_nome_usuario, $st_email, $st_login, $st_senha, $id_perfil));

        $this->addElement('submit', 'Enviar');
    }
}